The Refining the Shortest Paths (RSP) toolkit is a method for analyzing the fine-scale movements of aquatic animals tracked with passive acoustic telemetry in estuarine environments, that accounts for the surrounding land masses. The animal movements between detections are recreated to have occurred exclusively in water and the utilization distribution areas are limited by the land contours, providing realistic estimations of space use. The method can be divided into two main steps:
Depending on the research questions being addressed the utilization distribution areas can be calculated for the entire monitoring periods, or in fine-scale according to fixed temporal intervals (in hours). Tracked animals are assigned to specific biological groups (different species, different sexes from a same species, etc.) prior to analysis, and the RSP calculates the ammounts of inter-group overlap in space and time between all groups monitored. This approach allows spatial ecologists to use the outputs from such fine-scale space use models (areas of use, or between-group overlap frequencies) as input for further statistical analysis.
The RSP package can be downloaded using the following comand line:
install.packages("devtools")
library("devtools")
install_github("YuriNiella/RSP")
Analysing acoustic telemetry data requires a series of initial filtering to exclude misleading data, such as the presence of false detections or any transmitters getting detected before deployment dates. To overcome this issue and to use more accurate data for analysis, the RSP toolkit operates in close relationship with the actel package (Standardised analysis of acoustic telemetry data from fish moving through receiver arrays). Before getting started with RSP, you will have to download actel and filter your acoustic data. Please click here for more information and to download actel.
You will need the following input files:
More details on the format of input files can be found here. After downloading actel and placing the input files into the working directory, you have to use the explore() function to filter your acoustic data for analysis (click here for more information about the eplore() function):
library(actel)
study.data <- explore(tz.study.area = "Australia/Sydney")
Please note that the local timezone of your study area needs to be defined using the argument tz.study.area.
After filtering your acoustic data, you will need a raster file from your study area defining the water and land limits. This file will be used for estimating the shortest paths in water between consecutive acoustic detections, using a least-cost analysis of constrained random walks. The values of the raster cells must comprise zeros (water) or ones (land). Depending on the size of your study area, a resolution of 0.0001 is suggested for more accurate estimations (especially for sites with very narrow channels). Please see the following steps for generating and exporting a raster file from you study site in the QGIS software:
Load a good-resolution shapefile of your study region into QGIS:
Zoom into your study site and create an overlapping polygon that encompasses the entire area,
Clip your study site from the shapefile using “Vector > Geoprocessing Tools > Clip” setting the shapefile as the input layer and the overlap polygon as the overlay layer:
Create a raster layer from the Clipped shapefile using the “Rasterize” tool from the toolbox setting the Output Values to “data / no-data” and Cellsize to 0.0001 for a better resolution:
Right-click on the raster layer and select “Export > Save As…”. In the new window select the “Golden Software Binary Grid (.grd)” from the dropdown format menu. In the extent menu, select the “Calculate from Layer” option and then click on the “Clipped” layer:
install.packages(raster) # To install the raster package
library(raster)
LakeMacquarie <- raster("Lake Macquarie.grd") # Import the raster file exported from QGIS
plot(LakeMacquarie) # Plot raster from the study area
If the river channels look distorted go back to step 4 and choose a lower Cellsize. Please be aware* that increasing the raster resolution too much will require higher computational costs and may cause R to crash.
Now that your acoustic detections have been filtered and that you have a raster file with good resolution from your study area (exported into your working directory), you are all set to get started with RSP.
The RSP() function is used to recreate the shortest paths between pairs of acoustic detections. A transition layer object is calculated using the raster file to estimate these paths exclusively in the water. The raster is automatically imported during the analysis through the argument base.raster = "name_of_your_file.grd". Because this step can take some time depending on the size of your study area and the size of the raster cells, the transition layer will be saved for future re-analysis in case the detection data changes. When running the analysis again the following message is shown:
M: Reusing transition layer calculated on 2019-11-30 13:48:19.
If you want to calculate a new transition layer, delete the file 'rsp.transition.layer.RData' from your working directory.
The detection ranges of each listening station are also taken into account in the RSP(). These will be used as the location errors for the dBBMM when calculating UD areas. A ‘Range’ column can be included in the spatial file for specifying the detection ranges (in meters) for each acoustic station if these are known. If the ‘Range’ column is not found a default detection range of 500 m is automatically considered for each receiver with the warning:
W: Could not find a 'Range' column in the spatial file; assuming a range of 500 metres for each receiver.
While animals move between a pair of consecutive acoustic detections there is some uncertainty behind the possible movement patterns performed, which increases proportionally to the time taken. Consecutive detections longer than 24 hours are thus broken by the RSP() into separate ‘tracks’: the first one is assigned as the last position from the current track, and the second marks the start of a new one. This avoids the estimations of unrealistic behaviours when the animals do not get detected in the array for long periods of time. Detections that occur after more than 24-h from the previous one and before the next detection (e.g. a single detection on a particular day) are automatically excluded from analysis. The RSP() will return the percentage of raw detections that could be successfully used for refining the shortest paths when the analysis is finished:
M: Percentage of detections valid for RSP: 99.8%
Pairs of detections can only be of one of two types:
Estimated positions in water are added according to a fixed distance argument in meters (250 m by default) for consecutive detections on different receivers. A time.lapse parameter defines a time threshold in minutes (default is 10 min) to consider the animal as staying within the vicinity of the acoustic station. In other words, consecutive detections on a same receiver that occur after periods of time shorter than the time.lapse will not be interpolated. Again the uncertainty behind the possible movements performed are accounted for when intermediate positions are estimated.
While moving away from the first detection, the position errors gradually increase for each estimated position at a 5% rate of the detection range (default range of 500 m = 25 m errors) for that receiver. When the animal reaches half of the elapsed time between the first and the second detection, the errors of estimated positions now gradually decrease as it approaches the second receiver where it got detected. This principle is used for both pairs of detections on different receivers, and for consecutive detections at the same station when the time difference is longer than time.lapse.
A: consecutive detections on the save receiver; B: consecutive detections on different receivers.
Please see the following examples from the RSP() output:
| Timestamp | Receiver | Transmitter | Error | Longitude | Latitude | Position | Track |
|---|---|---|---|---|---|---|---|
| 2018-03-07 02:05:47 | 115409 | R64K-4075 | 500 | 9.380188 | 56.5716 | Receiver | Track_3 |
| 2018-03-07 02:30:37 | NA | R64K-4075 | 525 | 9.380188 | 56.5716 | RSP | Track_3 |
| 2018-03-07 02:55:27 | NA | R64K-4075 | 550 | 9.380188 | 56.5716 | RSP | Track_3 |
| 2018-03-07 03:20:18 | NA | R64K-4075 | 550 | 9.380188 | 56.5716 | RSP | Track_3 |
| 2018-03-07 03:45:08 | NA | R64K-4075 | 525 | 9.380188 | 56.5716 | RSP | Track_3 |
| 2018-03-07 04:09:59 | 115409 | R64K-4075 | 500 | 9.380188 | 56.5716 | Receiver | Track_3 |
The Position column in this dataset identifies the two consecutive acoustic detections (Receiver) from this animal. We can notice that they occurred on the same Receiver (115409): the first on 2018-03-07 02:05:47 and the second on 2018-03-07 04:09:59 (approximately 2-h from each other). Because this time difference is longer than the default time.lapse = 10, the RSP() estimated the intermediate positions (RSP) by repeating the receiver Longitude and Latitude and changing the Error parameter.
| Timestamp | Receiver | Transmitter | Error | Longitude | Latitude | Position | Track |
|---|---|---|---|---|---|---|---|
| 2018-04-27 05:27:10 | 100474 | R64K-4125 | 500 | 9.921725 | 57.05595 | Receiver | Track_5 |
| 2018-04-27 05:35:17 | NA | R64K-4125 | 525 | 9.928500 | 57.05450 | RSP | Track_5 |
| 2018-04-27 05:43:24 | NA | R64K-4125 | 550 | 9.935500 | 57.05350 | RSP | Track_5 |
| 2018-04-27 05:51:32 | NA | R64K-4125 | 575 | 9.943500 | 57.05450 | RSP | Track_5 |
| 2018-04-27 05:59:39 | NA | R64K-4125 | 600 | 9.949500 | 57.05650 | RSP | Track_5 |
| 2018-04-27 06:07:47 | NA | R64K-4125 | 625 | 9.955500 | 57.05850 | RSP | Track_5 |
| 2018-04-27 06:15:54 | NA | R64K-4125 | 650 | 9.960500 | 57.06150 | RSP | Track_5 |
| 2018-04-27 06:24:01 | NA | R64K-4125 | 625 | 9.964500 | 57.06550 | RSP | Track_5 |
| 2018-04-27 06:32:09 | NA | R64K-4125 | 600 | 9.968500 | 57.06850 | RSP | Track_5 |
| 2018-04-27 06:40:16 | NA | R64K-4125 | 575 | 9.975500 | 57.07050 | RSP | Track_5 |
| 2018-04-27 06:48:24 | NA | R64K-4125 | 550 | 9.981500 | 57.07250 | RSP | Track_5 |
| 2018-04-27 06:56:31 | NA | R64K-4125 | 525 | 9.986500 | 57.07450 | RSP | Track_5 |
| 2018-04-27 07:04:39 | 107527 | R64K-4125 | 500 | 9.992500 | 57.07650 | Receiver | Track_5 |
Here the animal was detected first at the Receiver 100474 on 2018-04-27 05:27:10, and then at the Receiver 107527 on 2018-04-27 07:04:39. The RSP() now calculated the shortest in-water path of the animal, and we can see how the Error of added locations increase from 500 at the first detection to 650 on 2018-04-27 06:15:54, and then back to 500 as the animal approaches the second receiver.
We can use plotDistances() to compare the total distances travelled by each animal calculated using only the receiver locations and or also including the RSP estimations:
The plotDetections() shows the total number of locations for positions of type Receiver and RSP for each tracked animal:
You can also plot all tracks from a particular animal using plotRSP():
# Plot tracks only with receiver locations:
plotRSP(input = rsp.data, tag = "R64K-4075", display = "Receiver", type = "lines")
# Plot tracks with RSP estimations:
plotRSP(input = rsp.data, tag = "R64K-4075", display = "RSP", type = "lines")
You can also set display == "Both" to plot both track options on a single plot.